struct Counter {
    number: i32,
}

impl Counter {
    fn new(number: i32) -> Self {
        Self { number }
    }

    // 不可变借用 &self = self: &self
    fn get(&self) {
        println!("result: {}", self.number);
    }

    // 可变借用 &mut self = self: &mut self
    fn increment(&mut self, value: i32) {
        self.number += value;
    }

    // Move self = self: Self
    fn clear(self) {
        println!("result: {}", self.number);
    }

    // Move
    fn combine(c1: Self, c2: Self) -> Self {
        Self {
            number: c1.number + c2.number,
        }
    }
}

fn main() {
    let mut c1 = Counter::new(1);
    c1.get();
    c1.increment(10);
}
